package com.zl.zlproject.base.activity;


import com.zl.zlproject.base.presenter.BaseContract;

/**
 * Created by 郑磊 on 2018/5/27.
 */

public abstract class BaseMvpActivity<P extends BaseContract.Presenter> extends BaseActivity implements BaseContract.View<P> {


    protected P mPresenter;

    @Override
    protected void initBefore() {
        super.initBefore();
        mPresenter = initPresenter();
    }



    /**
     * 初始化Presenter
     *
     * @return Presenter
     */
    protected abstract P initPresenter();


    @Override
    protected void onDestroy() {
        super.onDestroy();
        if(mPresenter!=null){
            mPresenter.destroy();
            mPresenter=null;
        }
    }


    @Override
    public void showLoadingDialog() {

    }


    @Override
    public void dismissLoadingDialog(){

    }
}
